package com.zksk.admin.domain.customer.vo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.zksk.admin.domain.agreement.vo.AgreementVo;
import com.zksk.common.core.web.domain.BaseEntity;
import com.zksk.mbg.admin.domain.Agreement;
import com.zksk.mbg.admin.domain.RRateCustomerReq;
import com.zksk.mbg.admin.domain.Rate;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 客户（平台）对产品要求
 * </p>
 *
 * @author Zksk Acmen
 * @since 2022-12-02
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "CustomerProdReq对象", description = "客户（平台）对产品要求")
public class CustomerProdReqVo extends BaseEntity {

    @ApiModelProperty("主键id")
    @JsonSerialize(using= ToStringSerializer.class)
    @NotNull(message = "ID不能为空!",groups = Update.class)
    private Long id;

    @ApiModelProperty("客户(平台)id")
    private Long customerId;

    @ApiModelProperty(value = "产品枚举ID",required = true)
    @NotNull(message = "产品未选择!",groups = Insert.class)
    private Long prodEnumId;

    @ApiModelProperty(value = "产品枚举名称",required = true)
    @NotNull(message = "产品未选择!",groups = Insert.class)
    private String prodEnumName;

    @ApiModelProperty("CA厂家名称(多个用逗号隔开)")
    private String caCompanyName;

    @ApiModelProperty("延标要求")
    private String delayRequire;

    @ApiModelProperty("预计上线时间")
    @JsonFormat(shape=JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime predictOnlineTime;

    @ApiModelProperty(value = "对接状态 0是 1否",required = true)
    private Integer dockingStatus;

    @ApiModelProperty(value = "出函后是否允许退订 0 允许退订 1 不允许退订",required = true)
    private Integer unsubscribeStatus;

    @ApiModelProperty(value = "允许理赔 0 允许理赔 1不允许理赔",required = true)
    private Integer allowClaims;

    @ApiModelProperty(value = "加密要求 0 需要加密 1无需加密",required = true)
    private Integer allowEncrypt;

    @ApiModelProperty("删除标识（0存在 2 删除）")
    @TableLogic
    private Integer delFlag;

    //**********************************************************************************************************

    @ApiModelProperty(value = "产品需求费率集合",required = true)
    private List<Rate> rateList;

    @ApiModelProperty(value = "产品需求协议集合",required = true)
    List<AgreementVo> agreementVos;

    @ApiModelProperty("支付方式集合")
    private List<String> paymentList; // 支付方式





    public static final String ID = "id";

    public static final String CUSTOMER_ID = "customer_id";

    public static final String PROD_ENUM_ID = "prod_enum_id";

    public static final String PROD_ENUM_NAME = "prod_enum_name";

    public static final String CA_COMPANY_NAME = "ca_company_name";

    public static final String DELAY_REQUIRE = "delay_require";

    public static final String PREDICT_ONLINE_TIME = "predict_online_time";

    public static final String DOCKING_STATUS = "docking_status";

    public static final String UNSUBSCRIBE_STATUS = "unsubscribe_status";

    public static final String ALLOW_CLAIMS = "allow_claims";

    public static final String ALLOW_ENCRYPT = "allow_encrypt";

    public static final String DEL_FLAG = "del_flag";

    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
